package com.example.demo.mongo;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.mongodb.core.index.TextIndexed;
import org.springframework.data.mongodb.core.mapping.Document;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Document(collection = "city")
public class CityEntity {
    private String id;
    private String pid;
//    @TextIndexed
    private String code;
    @TextIndexed
    private String name;

    @Override
    public String toString() {
        return "CityEntity{" +
                "id='" + id + '\'' +
                ", pid='" + pid + '\'' +
                ", code='" + code + '\'' +
                ", name='" + name + '\'' +
                '}';
    }
}
